package com.bao.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * User: cnlm
 * Date: 2020/05/22 10:29
 * Description: 只需要关注具体业务
 * Version: V1.0
 */
@Controller
public class UserController {
    /**
     * RequestMapping  :  请求映射
     *    value ： 请求URL地址 == action   value也可以不写
     *    method : 请求的方法 --  注明 ： 可以不写，如果不写，默认请求是什么它就用什么方法接收。
     *        RequestMethod.POST
     *        RequestMethod.GET
     */
    @RequestMapping(value = "/login.do",method = RequestMethod.POST)  //请求映射
    public String login(@RequestParam("name") String user_name, @RequestParam(defaultValue = "10")String user_pwd){ //登录
        System.out.println(user_name);
        System.out.println(user_pwd);
        System.out.println("=====登录====");
        return "";
    }

    @RequestMapping(value = "/register.do",method = RequestMethod.POST)  //请求映射
    public String register(String chs){//注册
        System.out.println("=======注册======="+ chs);
        return "";
    }


    @RequestMapping(value = "/queryUserList.do",method = RequestMethod.GET)  //请求映射
    public void queryUserList(@RequestParam(defaultValue = "1") int currentPage,@RequestParam(defaultValue = "10") Integer pageSize){
        System.out.println("当前页码数："+currentPage);
        System.out.println("每页显示条数："+pageSize);
    }

   /* @RequestMapping(value = "/addUser.do",method = RequestMethod.GET)  //请求映射
    public void addUser(@RequestParam(required = true) String user_name){
        System.out.println(user_name);
    }*/


}
